home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_i.lzh / graphics / gels.i < prev    next >
Text File  |  1991-03-14  |  9KB  |  211 lines

  1.     IFND    GRAPHICS_GELS_I
  2. GRAPHICS_GELS_I    SET    1
  3. **
  4. **    $Filename: graphics/gels.i $
  5. **    $Release: 2.04 $
  6. **    $Revision: 37.0 $
  7. **    $Date: 91/01/07 $
  8. **
  9. **    include file for AMIGA GELS (Graphics Elements)
  10. **
  11. **    (C) Copyright 1985,1986,1987,1988,1989 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. **
  14.  
  15.     IFND    EXEC_TYPES_I
  16.     include 'exec/types.i'
  17.     ENDC
  18.  
  19. *------ VS_vSflags ---------------------------------------------------
  20.  
  21. *   ;-- user-set vSprite flags --
  22. SUSERFLAGS  EQU $00FF          ; mask of all user-settable vSprite-flags
  23.     BITDEF  VS,VSPRITE,0      ; set if vSprite, clear if bob
  24.     BITDEF  VS,SAVEBACK,1     ; set if background is to be saved/restored
  25.     BITDEF  VS,OVERLAY,2      ; set to mask image of bob onto background
  26.     BITDEF  VS,MUSTDRAW,3     ; set if vSprite absolutely must be drawn
  27. *   ;-- system-set vSprite flags --
  28.     BITDEF  VS,BACKSAVED,8    ; this bob's background has been saved
  29.     BITDEF  VS,BOBUPDATE,9    ; temporary flag, useless to outside world
  30.     BITDEF  VS,GELGONE,10     ; set if gel is completely clipped (offscreen)
  31.     BITDEF  VS,VSOVERFLOW,11  ; vSprite overflow (if MUSTDRAW set we draw!)
  32.  
  33.  
  34. *------ B_flags ------------------------------------------------------
  35. *   ;-- these are the user flag bits --
  36. BUSERFLAGS  EQU $00FF         ; mask of all user-settable bob-flags
  37.     BITDEF  B,SAVEBOB,0       ; set to not erase bob
  38.     BITDEF  B,BOBISCOMP,1     ; set to identify bob as animComp
  39. *   ;-- these are the system flag bits --
  40.     BITDEF  B,BWAITING,8      ; set while bob is waiting on 'after'
  41.     BITDEF  B,BDRAWN,9        ; set when bob is drawn this DrawG pass
  42.     BITDEF  B,BOBSAWAY,10     ; set to initiate removal of bob
  43.     BITDEF  B,BOBNIX,11       ; set when bob is completely removed
  44.     BITDEF  B,SAVEPRESERVE,12 ; for back-restore during double-buffer
  45.     BITDEF  B,OUTSTEP,13      ; for double-clearing if double-buffer
  46.  
  47.  
  48. *------ defines for the animation procedures -------------------------
  49.  
  50. ANFRACSIZE  EQU 6
  51. ANIMHALF    EQU $0020
  52. RINGTRIGGER EQU $0001
  53.  
  54. *------ macros --------------------------------------------------------
  55. * these are GEL functions that are currently simple enough to exist as a
  56. * definition.  It should not be assumed that this will always be the case
  57.  
  58. InitAnimate MACRO   * &animKey
  59.        CLR.L   \1
  60.        ENDM
  61.  
  62.  
  63. RemBob      MACRO   * &b
  64.        OR.W    #BF_BOBSAWAY,b_BobFlags+\1
  65.        ENDM
  66.  
  67. *------ VS : vSprite -------------------------------------------------
  68.  STRUCTURE  VS,0    ; vSprite
  69. *   -- SYSTEM VARIABLES --
  70. *   GEL linked list forward/backward pointers sorted by y,x value
  71.     APTR    vs_NextVSprite    ; struct *vSprite
  72.     APTR    vs_PrevVSprite    ; struct *vSprite
  73. *   GEL draw list constructed in the order the bobs are actually drawn, then
  74. *   list is copied to clear list
  75. *   must be here in vSprite for system boundary detection
  76.     APTR    vs_DrawPath       ; struct *vSprite: pointer of overlay drawing
  77.     APTR    vs_ClearPath      ; struct *vSprite: pointer for overlay clearing
  78. *   the vSprite positions are defined in (y,x) order to make sorting
  79. *   sorting easier, since (y,x) as a long integer
  80.     WORD    vs_Oldy           ; previous position
  81.     WORD    vs_Oldx           ;
  82. *   -- COMMON VARIABLES --
  83.     WORD    vs_VSFlags        ; vSprite flags
  84. *   -- USER VARIABLES --
  85. *    the vSprite positions are defined in (y,x) order to make sorting
  86. *    easier, since (y,x) as a long integer
  87.     WORD    vs_Y              ; screen position
  88.     WORD    vs_X
  89.     WORD    vs_Height
  90.     WORD    vs_Width          ; number of words per row of image data
  91.     WORD    vs_Depth          ; number of planes of data
  92.     WORD    vs_MeMask         ; which types can collide with this vSprite
  93.     WORD    vs_HitMask        ; which types this vSprite can collide with
  94.     APTR    vs_ImageData      ; *WORD pointer to vSprite image
  95. *    borderLine is the one-dimensional logical OR of all
  96. *    the vSprite bits, used for fast collision detection of edge
  97.     APTR    vs_BorderLine     ; *WORD: logical OR of all vSprite bits
  98.     APTR    vs_CollMask       ; *WORD: similar to above except this is a 
  99. *    matrix pointer to this vSprite's color definitions (not used by bobs)
  100.     APTR    vs_SprColors      ; *WORD
  101.     APTR    vs_VSBob          ; struct *bob: points home if this vSprite is
  102.                   ;  part of a bob
  103. *    planePick flag:  set bit selects a plane from image, clear bit selects
  104. *      use of shadow mask for that plane
  105. *    OnOff flag: if using shadow mask to fill plane, this bit (corresponding
  106. *      to bit in planePick) describes whether to fill with 0's or 1's
  107. *    There are two uses for these flags:
  108. *           - if this is the vSprite of a bob, these flags describe how
  109. *         the bob is to be drawn into memory
  110. *           - if this is a simple vSprite and the user intends on setting
  111. *         the MUSTDRAW flag of the vSprite, these flags must be set
  112. *         too to describe which color registers the user wants for
  113. *         the image
  114.     BYTE    vs_PlanePick
  115.     BYTE    vs_PlaneOnOff
  116.     LABEL   vs_SUserExt       ; user definable
  117.     LABEL   vs_SIZEOF
  118.  
  119.  
  120. *------ BOB : bob ------------------------------------------------------
  121.  
  122.  STRUCTURE  BOB,0     ; bob: blitter object
  123. *   -- COMMON VARIABLES --
  124.     WORD    bob_BobFlags      ; general purpose flags (see definitions below)
  125. *   -- USER VARIABLES --
  126.     APTR    bob_SaveBuffer    ; *WORD pointer to the buffer for background
  127. *    save used by bobs for "cookie-cutting" and multi-plane masking
  128.     APTR    bob_ImageShadow   ; *WORD
  129. *    pointer to BOBs for sequenced drawing of bobs
  130. *      for correct overlaying of multiple component animations
  131.     APTR    bob_Before          ; struct *bob: draw this bob before bob pointed
  132.                   ; to by before
  133.     APTR    bob_After          ; struct *bob: draw this bob after bob pointed
  134.                   ; to by after
  135.     APTR    bob_BobVSprite    ; struct *vSprite: this bob's vSprite definition
  136.     APTR    bob_BobComp       ; struct *animComp: pointer to this bob's
  137.                   ; animComp def
  138.     APTR    bob_DBuffer       ; struct dBufPacket: pointer to this bob's 
  139.                               ; dBuf packet
  140.     LABEL   bob_BUserExt      ; bob user extension
  141.     LABEL   bob_SIZEOF
  142.  
  143. *------ AC : animComp ------------------------------------------------
  144.  
  145.  STRUCTURE  AC,0    ; animComp
  146. *   -- COMMON VARIABLES --
  147.     WORD    ac_CompFlags      ; animComp flags for system & user
  148. *    timer defines how long to keep this component active:
  149. *      if set non-zero, timer decrements to zero then switches to nextSeq
  150. *      if set to zero, animComp never switches
  151.     WORD    ac_Timer
  152. *   -- USER VARIABLES --
  153. *    initial value for timer when the animComp is activated by the system
  154.     WORD    ac_TimeSet
  155. *    pointer to next and previous components of animation object
  156.     APTR    ac_NextComp       ; struct *animComp
  157.     APTR    ac_PrevComp       ; struct *animComp
  158. *    pointer to component component definition of next image in sequence
  159.     APTR    ac_NextSeq        ; struct *animComp
  160.     APTR    ac_PrevSeq        ; struct *animComp
  161.     APTR    ac_AnimCRoutine   ; address of special animation procedure
  162.     WORD    ac_YTrans         ; initial y translation (if this is a component)
  163.     WORD    ac_XTrans         ; initial x translation (if this is a component)
  164.     APTR    ac_HeadOb         ; struct *animOb
  165.     APTR    ac_AnimBob        ; struct *bob
  166.     LABEL   ac_SIZE
  167.  
  168. *------ AO : animOb --------------------------------------------------
  169.  
  170.  STRUCTURE  AO,0    ; animOb
  171. *   -- SYSTEM VARIABLES --
  172.     APTR    ao_NextOb         ; struct *animOb
  173.     APTR    ao_PrevOb         ; struct *animOb
  174. *    number of calls to Animate this animOb has endured
  175.     LONG    ao_Clock
  176.     WORD    ao_AnOldY         ; old y,x coordinates
  177.     WORD    ao_AnOldX         ;
  178. *   -- COMMON VARIABLES --
  179.     WORD    ao_AnY            ; y,x coordinates of the animOb
  180.     WORD    ao_AnX            ;
  181. *   -- USER VARIABLES --
  182.     WORD    ao_YVel           ; velocities of this object
  183.     WORD    ao_XVel           ;
  184.     WORD    ao_XAccel         ; accelerations of this object
  185.     WORD    ao_YAccel         ;   !!! backwards !!!
  186.     WORD    ao_RingYTrans     ; ring translation values
  187.     WORD    ao_RingXTrans     ;
  188.     APTR    ao_AnimORoutine   ; address of special animation procedure
  189.     APTR    ao_HeadComp       ; struct *animComp: pointer to first component
  190.     LABEL   ao_AUserExt       ; animOb user extension
  191.     LABEL   ao_SIZEOF
  192.  
  193.  
  194. *------ DBP : dBufPacket ---------------------------------------------
  195. * dBufPacket defines the values needed to be saved across buffer to buffer
  196. *   when in double-buffer mode
  197.  
  198.  STRUCTURE  DBP,0             ; dBufPacket
  199.     WORD    dbp_BufY          ; save the other buffers screen coordinates
  200.     WORD    dbp_BufX          ;
  201.     APTR    dbp_BufPath       ; struct *vSprite: carry the draw path over
  202.                               ; the gap
  203. *    these pointers must be filled in by the user
  204. *    pointer to other buffer's background save buffer
  205.     APTR    dbp_BufBuffer     ; *WORD
  206. *    pointer to other buffer's background plane pointers
  207.     APTR    dbp_BufPlanes     ; **WORD
  208.     LABEL   dbp_SIZEOF
  209.  
  210.     ENDC    ; GRAPHICS_GELS_I
  211.